import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

const originalPush = Router.prototype.push
  Router.prototype.push = function push(location) {
    return originalPush.call(this, location).catch(err => err)
}

export default new Router({
  mode: 'hash',
  routes: [
      { path:'/', redirect: '/main'},
      { path: '/main', component: ()=>import('@/layout/main'), children: [
        { path:'home', component: ()=>import('@/layout/home')},
        // { path:'childApp1'},
        // { path:'childApp2'},
      ]},
      { path: '/main/*', component: ()=>import('@/layout/main') }
    ]
})

